import StatusBar from '../index.js'

class Terminal extends StatusBar {
  constructor(node) {
    super(node)
    this.node = node
  }
  //渲染弹出框dom
  renderPopupDom(params) {
    let dom = `<div class="popup-wrapper" style="width: ${params.popupWidth}"><p class="terminal-title">终端连接信息：</p>`
    for (let i in params.popupList) {
      let arr = params.popupList[i]
      dom += `<p class="terminal-type">${i}</p>
                        <ul class="popup-list">`
      arr.length &&
        arr.forEach((item, i) => {
          dom += `<li class="popup-list-item">
                                <span class="popup-item-name">${item.clientOsName}</span>
                            </li>`
        })
      !arr.length &&
        (dom += `<li class="popup-list-item"><span class="popup-item-name">暂无该类型</span</li>`)
      dom += `</ul>`
    }

    dom =
      dom +
      `<div class="arrow"></div>
                    </div>`
    return dom
  }
}
export default Terminal
